package Server.ClientObj;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class ClientThreadPool {
	private Map<String, ClientThread> map = Collections.synchronizedMap(new HashMap<String, ClientThread>());
	private static ClientThreadPool instance;
	
	private ClientThreadPool(){
		
	}
	
	public static ClientThreadPool getInstance(){
		if(instance == null){
			instance = new ClientThreadPool();
		}
		return instance;
	}
	
	public void addClient(ClientThread c){
		map.put(c.getName(), c);
	}

	public void clientDisconnect(ClientThread c) {
		map.remove(c.getName());
	}
}
